// pages/random/random.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    keyList: [{
      title: "地区",
      chichren: [{
        name: "华东",
        checked: true
      }, {
        name: "华北",
        checked: false
      }, {
        name: "华中",
        checked: false
      }, {
        name: "华南",
        checked: false
      }, {
        name: "华东",
        checked: false
      }]
    }, {
      title: "自然",
      chichren: [{
        name: "海",
        checked: false
      }, {
        name: "湖",
        checked: false
      }, {
        name: "雪",
        checked: false
      }, {
        name: "山",
        checked: false
      }, {
        name: "沙漠",
        checked: false
      }]
    }, {
      title: "人文",
      chichren: [{
        name: "古镇",
        checked: false
      }, {
        name: "古楼",
        checked: false
      }, {
        name: "遗址",
        checked: false
      }, {
        name: "宗教",
        checked: false
      }, {
        name: "乡村",
        checked: false
      }]
    }, {
      title: "颜色",
      chichren: [{
        name: "红色",
        checked: false
      }, {
        name: "绿色",
        checked: false
      }, {
        name: "蓝色",
        checked: false
      }, {
        name: "金色",
        checked: false
      }, {
        name: "古色",
        checked: false
      }]
    }, {
      title: "主题",
      chichren: [{
        name: "亲子",
        checked: false
      }, {
        name: "研学",
        checked: false
      }, {
        name: "康养",
        checked: false
      }, {
        name: "民俗",
        checked: false
      }, {
        name: "非遗",
        checked: false
      }]
    }, {
      title: "其他",
      chichren: [{
        name: "房车",
        checked: false
      }, {
        name: "安全",
        checked: false
      }, {
        name: "冒险",
        checked: false
      }, {
        name: "音乐节",
        checked: false
      }, {
        name: "森林",
        checked: false
      }]
    }]
  },
  // 激活/取消激活 选中状态。
  ToActive(e) {
    let that = this;
    var temp = that.data.keyList;
    temp[e.currentTarget.dataset.fa].chichren[e.currentTarget.dataset.index].checked = !temp[e.currentTarget.dataset.fa].chichren[e.currentTarget.dataset.index].checked
    that.setData({
      keyList: temp
    })
  },
  GoPage() {
    wx.navigateTo({
      url: '../find/artical/artical?id=1',
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})